home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir24
/
aprs60.zip
/
AUTOWX45.ZIP
/
ULTILOG.DOC
< prev
Wrap
Text File
|
1994-08-02
|
7KB
|
170 lines
The data log file is started with a 6 byte header. The data stream is
read and logged to the log file as follows:
The first byte is always F0.
Bytes 2 & 3 are the TIME in LSB MSB order.
The value of these bytes is the half the number of
seconds since midnite.
Example:
The SAMPLE.LOG (dated 05/21/93) file begins with the bytes:
F0 DC 50 95 2E 05
DC 50 is the time the file begins. The decimal value of
50DC is 20700. 20700 / 1800 = 11.5 which indicates the
file was begun at 11:30 a.m.
Value of MSBLSB / 1800 = Hours since midnite
Bytes 4 & 5 are the DATE.
Byte 4 indicates the month and day while byte 5 indicates
the year. January begins with 01, February with 21,
March with 41, and so on. The first day of the month
is added so that the 12th day of January would be 0D.
The 31st day of January would be 1F. (Don't forget, the
month begins at 00 which is January 0, not January 1.)
Byte 5 indicates the year. 1994 is 30 until the 9th
month when 31 is used. 08/01/94 is E1 30 and 09/01/94 is
01 31. 1995 is 32 & 33, etc.
To convert date to binary representation:
Yr% = (Year - 1950) + (Year - 1990)
If Month% > 8 then Month% = 1 : Yr% = Yr% +1
Mo% = (Month% * 32) - 32 + day%
LSB = CHR$(Mo%)
MSB = CHR$(Yr%)
To convert binary representation to date:
da% = VAL("&H" + RIGHT$(LSB$,1))
IF Mo% MOD 2 = 1 THEN Day% = Day% + 16
Yr% = VAL("&H" + MSB$)
Yr% = ((Yr% + 140) / 2) + 1900
Byte 6 is apparently always 05, presumably because the entries
are made at 5 minute intervals.
The data from the Ultimeter II weather station is logged
efficiently in log files by ULTIITSR because values are only
recorded if they have not changed since the previous entry. For
example, if the Wind Direction and Temperature are the same as
the last time they were logged, only the Wind Speed is logged.
The AUTOWX.EXE program, as of version 3.1 uses this same format.
In the SAMPLE.LOG the entries are:
02 00 02 00 04 00 7B 00
These bytes indicate "upper" rainfall amount: 02 00
The next four bytes are the "lower" rainfall: 02 00
The next four bytes are: 04 Wind direction
00 Wind speed
7B Temperature (LSB)
00 Temperature (MSB)
After the header is written, data is logged in the more efficient format
showing only changes since the last reading. For example, if only the
temperature changed, the entry would be 10 97 00 where 10 is the
indicator that only a temperature value follows. 97 00 is the
temperature (+56) in LSB MSB order. Rain amount is represented by 08H,
Wind Direction by 40H, Wind Speed by 20H and Temperature
by 10H. All other combinations are the result of adding these values.
ie. Temp change & Wind Speed Change: 10H + 20H = 30H The values would
then follow 30H; Wind Speed, 1 byte and Temp 2 bytes (LSB MSB). Note
that the rain amount and temperature are the only values that use 2
bytes.
The original ULTIITSR program uses a value of 80H to indicate when rain
amounts are reset to 0. AutoWx does not use the same algorithm but
writes a complete new header when rain amounts are reset. This saves
several lines of code but adds only a couple of bytes to the log file
when the reset is performed.
The temperature, as documented by Peet Bros., is the data value
minus 56. This allows for readings as low as -56F.
I have also noticed that the viewer (Ver 1) incorrectly displays the
wind speed. I don't know if this is due to a bug or to some conversion
that may be going on in the code but, in any case, if you look at the
values recorded in the log file and compare them to those displayed by
the viewer, they don't match. You can also compare the values displayed
on the U-II and you'll see that they do not match the values recorded in
the log file. The numbers are also fouled up if you choose other than 5
minute intervals when listing tables.
By the way, I use MS-DOS Debug to view and work on log files when
experimenting/snooping around. If you are not familiar with
DEBUG, be careful. You can mess up an entire disk.
To view a log file, type in DEBUG SAMPLE.LOG at the DOS prompt.
Then, at the minus sign (-), type D and press RETURN. Repeat to
see more. Enter "Q" at the - sign to quit and return to DOS.
Those familiar with Debug, or those that have other utility
programs, such as a BIN to HEX program can change bytes, etc. If you
are not familiar with DEBUG don't try doing anything but (D)isplaying
and (Q)uitting files. Two log files can be appended by using:
COPY /B file1+file2 BIGFILE.LOG
If you have comments or if you develop other U-II software,
please contact me by mail or by packet at N5RKN.#WTX BBS
73 de Les, N5KOA
Mon. 1994 00 - No changes 0000 0000 0
JAN 01 30 08 - Rain 0000 1000 8
FEB 21 30 10 - Temp 0001 0000 16
MAR 41 30 18 - Temp & Rain 0001 1000 24
APR 61 30 20 - Speed 0010 0000 32
MAY 81 30 28 - Speed & Rain 0010 1000 40
JUN A1 30 30 - Temp & Speed 0011 0000 48
JUL C1 30 38 - Temp, Speed & Rain 0011 1000 56
AUG E1 30 40 - Direction 0100 0000 64
48 - Dir & Rain 0100 1000 72
SEP 01 31 50 - Dir & Temp 0101 0000 80
OCT 21 31 58 - Dir, Temp & Rain 0101 1000 88
NOV 41 31 60 - Direction & Speed 0110 0000 96
DEC 61 31 68 - Dir, Speed, Rain 0110 1000 104
70 - Dir, Speed, & Temp 0111 0000 112
78 - Dir, Speed, Temp & Rain 0111 1000 120
A0 - Time, Date, Rain Reset 128+
E0 - Time, Date, Rain Reset 128+
N = 10 E = 04 S = 08 W = 0C
NNE = 01 ESE = 05 SSW = 09 WNW = 0D
NE = 02 SE = 06 SW = 0A NW = 0E
ENE = 03 SSE = 07 WSW = 0B NNW = 0F